package cn.ly.jvm;

public class JavaVMStackSOF {
	
	private int stackLength = 1;
	public void stackLeak(){
		stackLength++;
		stackLeak();//调用一个方法，对应一个栈帧入栈
	}
	
	public static void main(String[] args) {
		JavaVMStackSOF oom = new JavaVMStackSOF();
		try{
			oom.stackLeak();
		}catch(Throwable e){
			System.out.println("stack length:" + oom.stackLength);
			throw e;
		}
	}

}
